package com.molichuxing.services.property;

public enum PyIdverifyExternalStatusEnum {
	
	/**
     * 正常
     */
	NORMAL("1", "正常"),
	
	/**
	 * 异常
	 */
	ABNORMAL("2", "异常"),
	
	/**
     * 调用第三方服务异常
     */
	SERVICE_EXCEPTIONS("500", "调用第三方服务异常");

	String value;
    String name;

    PyIdverifyExternalStatusEnum(String value, String name) {
        this.value = value;
        this.name = name;
    }

    public String getValue() {
        return value;
    }

    public String getName() {
        return name;
    }


    /**
     * 通过value获取枚举的name
     *
     * @param value
     * @return
     */
    public static String getName(String value) {
        PyIdverifyExternalStatusEnum enumerate = getEnum(value);
        return enumerate == null ? null : enumerate.getName();
    }

    /**
     * 通过value获取枚举
     *
     * @param value
     * @return
     */
    public static PyIdverifyExternalStatusEnum getEnum(String value) {
        for (PyIdverifyExternalStatusEnum enumerate : PyIdverifyExternalStatusEnum.values()) {
            	if(enumerate.getValue().equals(value)){
            		 return enumerate;
            	}
        }
        return null;
    }
}
